/*
 * @Description: 
 * @Version: 2.0
 * @Autor: lxc
 * @Date: 2020-12-18 17:19:33
 * @LastEditors: lxc
 * @LastEditTime: 2020-12-24 15:05:18
 */
const mongoose = require("mongoose");
const Schema = mongoose.Schema;

// Create Schema
const OrderSchema = new Schema({
    user: {
        type: Schema.Types.ObjectId,
        ref: "users"
    },
    expendName: {
        type: String,
        required: true
    },
    classifyId: {
        type: String,
        required: true
    },
    classifyName: {
        type: String,
        required: true
    },
    expendMoney: {
        type: Number,
        required: true
    },
    date: {
        type: Date,
        default: Date.now
    }
})

module.exports = Order = mongoose.model("orders", OrderSchema);